import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XyywShopProductCommentLikeForm, XyywShopProductCommentLikeQuery, XyywShopProductCommentLikeVo } from '@/api/xyyw/model/shopProductCommentLikeModel';
import { request } from '@/utils/request';

// 查询讨论点赞列表
export function listShopProductCommentLike(query?: XyywShopProductCommentLikeQuery) {
  return request.get<TableDataInfo<XyywShopProductCommentLikeVo>>({
    url: '/xyyw/shopProductCommentLike/list',
    params: query,
  });
}

// 查询讨论点赞详细
export function getShopProductCommentLike(discussionLikeId: number) {
  return request.get<R<XyywShopProductCommentLikeVo>>({
    url: `/xyyw/shopProductCommentLike/${discussionLikeId}`,
  });
}

// 新增讨论点赞
export function addShopProductCommentLike(data: XyywShopProductCommentLikeForm) {
  return request.post<R<void>>({
    url: '/xyyw/shopProductCommentLike',
    data,
  });
}

// 修改讨论点赞
export function updateShopProductCommentLike(data: XyywShopProductCommentLikeForm) {
  return request.put<R<void>>({
    url: '/xyyw/shopProductCommentLike',
    data,
  });
}

// 删除讨论点赞
export function delShopProductCommentLike(discussionLikeIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xyyw/shopProductCommentLike/${discussionLikeIds}`,
  });
}
